<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="format-detection" content="telephone=no,email=no,adress=no">
<link href="<%=request.getContextPath()%>/css/global.css" type="text/css" rel="stylesheet" />
<link href="<%=request.getContextPath() %>/js/easyui/themes/metro/easyui.css" type="text/css" rel="stylesheet"/>
<link href="<%=request.getContextPath() %>/js/date/skin/WdatePicker.css" type="text/css" rel="stylesheet"/>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/global.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/easyui/easyui.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/date/WdatePicker.js"></script>
<script type="text/javascript">

$(function(){

	$("#dataTable").datagrid({
		toolbar: '#dataSearch',
		fitColumns:true,
		striped: true, 
		singleSelect:false,
		pagination:true,
		rownumbers:true,
		SelectOnCheck:true,
		CheckOnSelect:true,
        onSelect: function(index,row){
        	var nos="";
        	var rows = $('#dataTable').datagrid('getSelections');
        	for(var i=0; i<rows.length; i++){
        		nos=nos+rows[i].ck+",";
        	}
			$("#keys").val(nos);
    	},
    	onUnselect: function(index,row){
        	var nos="";
        	var rows = $('#dataTable').datagrid('getSelections');
        	for(var i=0; i<rows.length; i++){
        		nos=nos+rows[i].ck+",";
        	}
			$("#keys").val(nos);
    	},
    	onSelectAll: function(rows){
        	var nos="";
        	for(var i=0; i<rows.length; i++){
        		nos=nos+rows[i].ck+",";
        	}
			$("#keys").val(nos);
    	},
    	onUnselectAll: function(rows){
			$("#keys").val("");
    	}
	});
	
	$('#dataTable').datagrid('getPager').pagination({
		total:<s:property value="pageInfo.pageRecord"/>,
		pageNumber:<s:property value="pageInfo.pageIndex"/>,
		pageSize:<s:property value="pageInfo.pageSize"/>,
		pageList: [20,50,100] ,
		onSelectPage:function(pageNumber,pageSize){  
			toPage(pageNumber,pageSize);
		},
		onRefresh:function(pageNumber,pageSize){  
			location.reload();
		}
	});
	
});

</script>
</head>
<body >
<div id="dataSearch" >    
<form id="sform" action="csm_listsc.html" method="get" enctype="multipart/form-data">
<table style="width: 100%;">
<tr>
<td height="25" >
	<b>操作说明:多个流水号可以用逗号隔开</b> 
</td>
</tr>
<tr><td height="30" >
<s:textfield  id="scNo" name="scNo" placeholder="编号"></s:textfield>
<s:textfield  id="crdNo" name="crdNo" placeholder="关联卡号"></s:textfield>
<s:textfield  id="txnNo" name="txnNo" placeholder="关联交易号"></s:textfield>
<s:select id="scType" name="scType"  list="@dicts.PaymentDict@SC_TYPE" headerKey="" headerValue="SC类型"/>
<s:select id="scState" name="scState" list="#{'1':'有效','0':'无效'}" headerKey="" headerValue="状态"/>

<s:textfield  id="scDateTop"  name="scDateTop" placeholder="发生日期起"  onclick="WdatePicker();"  cssStyle="width:100px;" ><s:param name="value"><s:date name="scDateTop" format="yyyy-MM-dd"/></s:param></s:textfield>
 - 
<s:textfield  id="scDateEnd"  name="scDateEnd" placeholder="发生日期止"  onclick="WdatePicker();"  cssStyle="width:100px;" ><s:param name="value"><s:date name="scDateEnd" format="yyyy-MM-dd"/></s:param></s:textfield>

<input type="button" class="submit" value="查询搜索" onclick="sform.submit();"/></td>
</tr>
<tr><td><hr/></td></tr>
<tr>
<td height="30" >
	<input type="hidden"  id="keys" name="keys"  value=""/>
		<input type="button" class="submit"   value="导出数据"  onclick="if(confirm('确认要执行导出操作吗?')){window.open(location.href.replace('list','export'));}"/>
		&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="button" class="submit" value="编号排序" onclick="toSort('sortField','scNo')"/>
		<input type="button" class="submit" value="日期排序" onclick="toSort('sortField','scDate')"/>
		
		&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="button" class="submit" value="升序排列" onclick="toSort('sortOrder','true')"/>
		<input type="button" class="submit" value="降序排列" onclick="toSort('sortOrder','false')"/>
</td>
</tr>
</table>
</form>
</div>

<table id="dataTable" style="width: 100%;" class="easyui-datagrid" >
<thead>
<tr>
<th data-options="field:'ck'" checkbox="true"></th>
<th data-options="field:'scNo', width:'15%',align:'left' , halign: 'left'">编号</th>
<th data-options="field:'crdNo', width:'15%',align:'left' , halign: 'left'">关联卡号</th>
<th data-options="field:'txnNo', width:'15%',align:'left' , halign: 'left'">关联交易号</th>
<th data-options="field:'scType', width:'10%',align:'left' , halign: 'left'">类型</th>
<th data-options="field:'scAmount', width:'8%',align:'left' , halign: 'left'">付款金额</th>
<th data-options="field:'scState', width:'5%',align:'left' , halign: 'left'">状态</th>
<th data-options="field:'scDate', width:'10%',align:'left' , halign: 'left'">发生日期</th>
<th data-options="field:'scRemark', width:'15%',align:'left' , halign: 'left'">备注</th>
<th data-options="field:'op', width:'100',align:'left' , halign: 'left'">操作</th>

</tr>
</thead>
<tbody>
<s:iterator value="scList" id="show" status="seq">
<tr>
<td><s:property value="#show.scNo"/></td>
<td><a href="<%=request.getContextPath()%>/csm_showsc.html?scNo=<s:property value="#show.scNo"/>"><s:property value="#show.scNo"/></a></td>
<td><a href="<%=request.getContextPath()%>/card_show.html?crdNo=<s:property value="#show.crdNo"/>"><s:property value="#show.crdNo"/></a></td>
<td><a href="<%=request.getContextPath()%>/transaction_show.html?txnNo=<s:property value="#show.txnNo"/>"><s:property value="#show.txnNo"/></a></td>
<td><s:property value="#show.scType"/></td>
<td><s:text name="global.format.number"><s:param value="#show.scAmount"/></s:text></td>
<td><s:if test="#show.scState==0"><img src="<%=request.getContextPath() %>/image/cancel.png"  /></s:if><s:else><img src="<%=request.getContextPath() %>/image/accept.png"  /></s:else></td>
<td><s:text name="global.format.dateminute"><s:param value="#show.scDate"/></s:text>
<td><s:property value="#show.scRemark"/></td>
<td>
<input type="button" value="查看" style="width: 50px;" class="submit" onclick="location.href='<%=request.getContextPath()%>/csm_showsc.html?scNo=<s:property value="#show.scNo"/>'"/>
</td>

</tr>
</s:iterator>
</tbody>
</table>
<br/>
<br/>
<br/>
</body>
</html>
